class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.z: B = None
        self.p: B = None
        self.x: E = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.q: E = None
        self.z: B = None
        self.s: B = None
        self.p: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.q: E = None
        self.z: B = None
        self.s: B = None
        self.p: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

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

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