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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.u: B = None
        self.x: C = None
        self.o: B = None
        self.t: D = None
        self.txt = txt

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

k = A("k")
f = B("f")
l = C("l")
j = D("j")
g = E("g")
n = F("n")
a = F("a")
c = E("c")
h = B("h")

k.o = g
k.t = g
k.v = j
k.r = j
k.x = a
k.q = a
f.u = j
l.x = g
l.o = n
l.w = j
l.s = a
l.y = h
l.v = c
j.p = g
j.q = h
g.p = k
g.u = f
g.o = f
g.x = l
g.t = j
n.o = a
n.v = k
n.r = j
a.o = n
a.v = k
a.r = j
c.p = k
c.u = h
c.x = l
c.o = f
c.t = j
h.u = j
assert k.r.q.u.p.u.u.q.u.p.txt == "
class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.t: E = None
        self.v: D = None
        self.x: F = None
        self.r: D = None
        self.q: F = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.u: B = None
        self.x: C = None
        self.o: B = None
        self.t: D = None
        self.txt = txt

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

k = A("k")
f = B("f")
l = C("l")
j = D("j")
g = E("g")
n = F("n")
a = F("a")
c = E("c")
h = B("h")

k.o = g
k.t = g
k.v = j
k.r = j
k.x = a
k.q = a
f.u = j
l.x = g
l.o = n
l.w = j
l.s = a
l.y = h
l.v = c
j.p = g
j.q = h
g.p = k
g.u = f
g.o = f
g.x = l
g.t = j
n.o = a
n.v = k
n.r = j
a.o = n
a.v = k
a.r = j
c.p = k
c.u = h
c.x = l
c.o = f
c.t = j
h.u = j
assert k.r.q.u.p.u.u.q.u.p.txt == "g"