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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.r: F = None
        self.p: B = None
        self.w: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.w: A = None
        self.txt = txt

h = A("h")
b = B("b")
f = C("f")
m = D("m")
c = E("c")
j = F("j")
g = G("g")
n = C("n")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.r: F = None
        self.p: B = None
        self.w: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.w: A = None
        self.txt = txt

h = A("h")
b = B("b")
f = C("f")
m = D("m")
c = E("c")
j = F("j")
g = G("g")
n = C("n")

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