class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: F = None
        self.o: D = None
        self.r: D = None
        self.w: D = None
        self.v: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.r: A = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.r: A = None
        self.txt = txt

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

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

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

h.u = c
h.t = n
h.v = n
h.o = m
h.r = m
h.w = m
b.x = j
b.q = n
c.t = h
c.r = b
m.t = n
m.r = h
j.x = b
n.u = j
assert j.x.q.u.x.q.txt == "n"