class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.z: F = None
        self.o: E = None
        self.w: D = None
        self.y: F = None
        self.v: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.x: F = None
        self.t: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.w: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.r: A = None
        self.t: D = None
        self.s: A = None
        self.txt = txt

f = A("f")
e = B("e")
b = C("b")
j = D("j")
n = E("n")
h = F("h")

f.q = b
f.z = h
f.y = h
f.o = n
f.w = j
f.v = j
e.q = j
e.x = h
e.t = b
b.p = n
b.w = n
j.y = n
n.p = f
h.y = n
h.r = f
h.s = f
h.t = j
assert e.t.w.p.y.y.p.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.z: F = None
        self.o: E = None
        self.w: D = None
        self.y: F = None
        self.v: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.x: F = None
        self.t: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.w: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.r: A = None
        self.t: D = None
        self.s: A = None
        self.txt = txt

f = A("f")
e = B("e")
b = C("b")
j = D("j")
n = E("n")
h = F("h")

f.q = b
f.z = h
f.y = h
f.o = n
f.w = j
f.v = j
e.q = j
e.x = h
e.t = b
b.p = n
b.w = n
j.y = n
n.p = f
h.y = n
h.r = f
h.s = f
h.t = j
assert e.t.w.p.y.y.p.txt == "f"