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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.w: D = None
        self.u: H = None
        self.t: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: E = None
        self.r: A = None
        self.s: D = None
        self.q: E = None
        self.p: C = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.w: D = None
        self.u: H = None
        self.t: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: E = None
        self.r: A = None
        self.s: D = None
        self.q: E = None
        self.p: C = None
        self.txt = txt

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

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

k.x = d
k.p = e
j.w = g
j.s = g
j.t = n
j.o = n
j.x = d
j.r = d
j.p = f
n.q = f
n.r = d
n.t = e
d.r = g
d.x = n
f.s = j
f.u = k
g.v = d
g.w = d
g.u = e
g.t = f
b.y = f
b.q = f
b.r = k
b.s = d
b.p = n
e.u = f
assert n.t.u.u.x.r.txt == "g"