class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.v: E = None
        self.t: F = None
        self.z: C = None
        self.y: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.s: E = None
        self.o: F = None
        self.z: F = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.s: E = None
        self.o: F = None
        self.z: F = None
        self.txt = txt

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

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

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

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

j.x = g
j.t = g
j.y = g
j.v = k
j.z = c
m.r = l
m.u = k
c.q = g
c.o = g
c.z = g
c.s = k
h.r = g
k.y = h
k.w = h
k.t = h
g.s = h
g.z = m
l.x = g
l.t = g
l.y = g
l.v = k
l.z = c
assert h.r.z.r.z.q.s.txt == "h"