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

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

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

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

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

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

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

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

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

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

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

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

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

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

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