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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.w: B = None
        self.x: F = None
        self.txt = txt

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

i = A("i")
j = B("j")
e = C("e")
f = D("f")
a = E("a")
h = F("h")
b = E("b")
d = E("d")
k = C("k")

i.y = h
j.z = e
j.v = f
j.x = f
j.u = d
e.v = j
e.w = j
e.q = j
e.s = d
e.x = i
e.u = f
f.t = i
f.r = j
a.s = h
a.x = h
a.w = j
h.r = d
h.v = f
b.s = h
b.x = h
b.w = j
d.s = h
d.x = h
d.w = j
k.v = j
k.w = j
k.q = j
k.s = d
k.x = i
k.u = f
assert f.t.y.v.txt == "
class A:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.w: B = None
        self.x: F = None
        self.txt = txt

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

i = A("i")
j = B("j")
e = C("e")
f = D("f")
a = E("a")
h = F("h")
b = E("b")
d = E("d")
k = C("k")

i.y = h
j.z = e
j.v = f
j.x = f
j.u = d
e.v = j
e.w = j
e.q = j
e.s = d
e.x = i
e.u = f
f.t = i
f.r = j
a.s = h
a.x = h
a.w = j
h.r = d
h.v = f
b.s = h
b.x = h
b.w = j
d.s = h
d.x = h
d.w = j
k.v = j
k.w = j
k.q = j
k.s = d
k.x = i
k.u = f
assert f.t.y.v.txt == "f"