class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.x: H = None
        self.s: E = None
        self.u: D = None
        self.v: H = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.q: A = None
        self.z: H = None
        self.p: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: C = None
        self.u: D = None
        self.txt = txt

b = A("b")
c = B("c")
a = C("a")
d = D("d")
g = E("g")
k = F("k")
j = G("j")
f = H("f")

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.q: A = None
        self.z: H = None
        self.p: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: C = None
        self.u: D = None
        self.txt = txt

b = A("b")
c = B("c")
a = C("a")
d = D("d")
g = E("g")
k = F("k")
j = G("j")
f = H("f")

b.o = g
b.s = g
b.x = f
b.v = f
b.u = d
c.t = g
a.u = j
a.r = j
d.u = g
g.u = a
g.r = d
k.q = c
k.x = g
k.u = d
j.q = b
j.z = f
j.p = a
f.o = a
f.u = d
assert c.t.u.r.q.u.txt == "d"