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

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

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.z: B = None
        self.o: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.r: B = None
        self.p: C = None
        self.o: C = None
        self.w: B = None
        self.y: C = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.z: B = None
        self.o: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.r: B = None
        self.p: C = None
        self.o: C = None
        self.w: B = None
        self.y: C = None
        self.txt = txt

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

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

g.u = l
h.t = d
h.r = l
h.o = f
h.v = f
h.p = a
i.r = f
i.z = h
i.o = h
l.w = i
d.v = l
d.r = h
d.p = i
d.o = e
d.y = e
d.w = f
a.r = f
c.r = f
e.r = h
e.o = h
e.z = f
f.t = d
f.r = l
f.o = h
f.v = h
f.p = a
b.r = f
b.o = f
b.z = h
assert c.r.v.t.txt == "d"