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

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

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.p: B = None
        self.o: B = None
        self.x: A = None
        self.q: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.o: C = None
        self.q: F = None
        self.y: B = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.p: B = None
        self.o: B = None
        self.x: A = None
        self.q: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.o: C = None
        self.q: F = None
        self.y: B = None
        self.txt = txt

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

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

d.z = g
i.r = d
i.p = g
i.t = g
i.u = k
i.s = b
i.v = h
b.v = e
b.p = i
b.o = i
b.q = i
b.x = d
h.y = d
k.t = d
k.o = b
k.q = e
k.y = i
e.o = k
e.q = b
e.v = b
f.r = d
f.p = g
f.t = g
f.u = k
f.s = b
f.v = h
g.o = k
g.q = b
g.v = b
assert g.o.t.z.txt == "g"