class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.p: B = None
        self.x: B = None
        self.y: B = None
        self.z: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: B = None
        self.s: D = None
        self.w: B = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.z: F = None
        self.p: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.w: B = None
        self.u: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.x: A = None
        self.y: A = None
        self.txt = txt

l = A("l")
j = B("j")
h = C("h")
m = D("m")
c = E("c")
n = F("n")
d = C("d")
g = B("g")

l.q = c
l.p = g
l.x = g
l.y = j
l.z = j
j.t = g
j.w = g
j.s = m
h.q = g
h.z = n
h.p = d
m.z = d
m.w = g
m.u = g
c.w = l
n.p = j
n.x = l
n.y = l
d.q = j
d.z = n
d.p = h
g.t = j
g.w = j
g.s = m
assert l.y.s.z.q.s.u.t.txt == "
class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.p: B = None
        self.x: B = None
        self.y: B = None
        self.z: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: B = None
        self.s: D = None
        self.w: B = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.z: F = None
        self.p: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.w: B = None
        self.u: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.x: A = None
        self.y: A = None
        self.txt = txt

l = A("l")
j = B("j")
h = C("h")
m = D("m")
c = E("c")
n = F("n")
d = C("d")
g = B("g")

l.q = c
l.p = g
l.x = g
l.y = j
l.z = j
j.t = g
j.w = g
j.s = m
h.q = g
h.z = n
h.p = d
m.z = d
m.w = g
m.u = g
c.w = l
n.p = j
n.x = l
n.y = l
d.q = j
d.z = n
d.p = h
g.t = j
g.w = j
g.s = m
assert l.y.s.z.q.s.u.t.txt == "j"