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

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

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

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.v: B = None
        self.q: G = None
        self.o: E = None
        self.t: A = None
        self.z: B = None
        self.p: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.u: G = None
        self.o: A = None
        self.z: B = None
        self.v: D = None
        self.txt = txt

m = A("m")
i = B("i")
k = C("k")
g = D("g")
f = E("f")
d = F("d")
c = G("c")
b = F("b")
l = G("l")
h = G("h")

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

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

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

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.v: B = None
        self.q: G = None
        self.o: E = None
        self.t: A = None
        self.z: B = None
        self.p: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.u: G = None
        self.o: A = None
        self.z: B = None
        self.v: D = None
        self.txt = txt

m = A("m")
i = B("i")
k = C("k")
g = D("g")
f = E("f")
d = F("d")
c = G("c")
b = F("b")
l = G("l")
h = G("h")

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