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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.w: C = None
        self.t: E = None
        self.x: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.t: F = None
        self.w: A = None
        self.z: F = None
        self.p: E = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.w: C = None
        self.t: E = None
        self.x: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.t: F = None
        self.w: A = None
        self.z: F = None
        self.p: E = None
        self.txt = txt

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

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