class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.s: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.z: C = None
        self.w: H = None
        self.x: H = None
        self.u: H = None
        self.v: C = None
        self.p: G = None
        self.txt = txt

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

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

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

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

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

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

n = A("n")
b = B("b")
k = C("k")
g = D("g")
h = E("h")
m = F("m")
d = G("d")
c = H("c")

n.p = m
n.s = k
b.t = g
b.z = k
b.v = k
b.w = c
b.x = c
b.u = c
b.p = d
k.s = h
g.r = b
h.r = n
m.u = k
m.w = g
d.u = g
c.q = g
c.t = k
c.o = n
c.r = d
c.u = h
assert k.s.r.p.w.r.txt == "
class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.s: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.z: C = None
        self.w: H = None
        self.x: H = None
        self.u: H = None
        self.v: C = None
        self.p: G = None
        self.txt = txt

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

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

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

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

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

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

n = A("n")
b = B("b")
k = C("k")
g = D("g")
h = E("h")
m = F("m")
d = G("d")
c = H("c")

n.p = m
n.s = k
b.t = g
b.z = k
b.v = k
b.w = c
b.x = c
b.u = c
b.p = d
k.s = h
g.r = b
h.r = n
m.u = k
m.w = g
d.u = g
c.q = g
c.t = k
c.o = n
c.r = d
c.u = h
assert k.s.r.p.w.r.txt == "b"