class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.o: A = None
        self.y: D = None
        self.x: A = None
        self.p: H = None
        self.r: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.r: B = None
        self.s: F = None
        self.q: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: C = None
        self.z: H = None
        self.v: E = None
        self.r: H = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.o: A = None
        self.y: D = None
        self.x: A = None
        self.p: H = None
        self.r: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.r: B = None
        self.s: F = None
        self.q: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: C = None
        self.z: H = None
        self.v: E = None
        self.r: H = None
        self.txt = txt

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

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

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