class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.y: F = None
        self.u: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.x: F = None
        self.s: F = None
        self.v: F = None
        self.p: A = None
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.u: B = None
        self.q: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.r: C = None
        self.u: D = None
        self.p: A = None
        self.q: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.x: F = None
        self.s: F = None
        self.v: F = None
        self.p: A = None
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.u: B = None
        self.q: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.r: C = None
        self.u: D = None
        self.p: A = None
        self.q: C = None
        self.txt = txt

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

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