class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.z: D = None
        self.v: E = None
        self.t: E = None
        self.y: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.v: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.v: E = None
        self.w: B = None
        self.x: B = None
        self.r: D = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.t: C = None
        self.r: E = None
        self.txt = txt

h = A("h")
c = B("c")
j = C("j")
i = D("i")
g = E("g")
d = F("d")
l = F("l")
f = E("f")
e = D("e")

h.q = i
c.q = e
c.z = i
c.v = f
c.t = g
c.y = j
j.o = g
j.v = f
i.q = c
i.w = c
i.x = c
i.v = g
i.r = e
g.s = h
g.z = l
d.v = g
d.t = j
d.r = f
l.v = f
l.t = j
l.r = g
f.s = h
f.z = l
e.q = c
e.w = c
e.x = c
e.v = g
e.r = i
assert f.z.t.v.txt == "
class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.z: D = None
        self.v: E = None
        self.t: E = None
        self.y: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.v: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.v: E = None
        self.w: B = None
        self.x: B = None
        self.r: D = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.t: C = None
        self.r: E = None
        self.txt = txt

h = A("h")
c = B("c")
j = C("j")
i = D("i")
g = E("g")
d = F("d")
l = F("l")
f = E("f")
e = D("e")

h.q = i
c.q = e
c.z = i
c.v = f
c.t = g
c.y = j
j.o = g
j.v = f
i.q = c
i.w = c
i.x = c
i.v = g
i.r = e
g.s = h
g.z = l
d.v = g
d.t = j
d.r = f
l.v = f
l.t = j
l.r = g
f.s = h
f.z = l
e.q = c
e.w = c
e.x = c
e.v = g
e.r = i
assert f.z.t.v.txt == "f"