class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.u: G = None
        self.z: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: H = None
        self.t: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.o: D = None
        self.y: G = None
        self.w: F = None
        self.r: C = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.q: C = None
        self.u: G = None
        self.o: E = None
        self.s: G = None
        self.txt = txt

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

b.p = m
b.u = k
b.z = e
e.r = j
e.x = f
j.s = g
j.t = e
f.s = k
c.z = j
c.r = j
c.o = f
c.y = k
c.w = m
m.x = c
k.z = b
k.s = g
g.q = j
g.u = k
g.s = k
g.o = c
assert b.u.z.u.txt == "
class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.u: G = None
        self.z: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: H = None
        self.t: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.o: D = None
        self.y: G = None
        self.w: F = None
        self.r: C = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.q: C = None
        self.u: G = None
        self.o: E = None
        self.s: G = None
        self.txt = txt

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

b.p = m
b.u = k
b.z = e
e.r = j
e.x = f
j.s = g
j.t = e
f.s = k
c.z = j
c.r = j
c.o = f
c.y = k
c.w = m
m.x = c
k.z = b
k.s = g
g.q = j
g.u = k
g.s = k
g.o = c
assert b.u.z.u.txt == "k"