class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.u: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: G = None
        self.q: G = None
        self.o: C = None
        self.w: A = None
        self.txt = txt

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

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.u: G = None
        self.q: G = None
        self.o: C = None
        self.w: A = None
        self.txt = txt

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

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

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

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

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

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

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