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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: C = None
        self.s: G = None
        self.q: C = None
        self.txt = txt

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

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

c = A("c")
b = B("b")
n = C("n")
a = D("a")
j = E("j")
f = F("f")
i = G("i")

c.t = a
c.o = j
c.v = j
c.p = n
b.s = f
n.q = i
n.p = c
n.o = f
n.u = f
n.r = a
a.p = n
j.u = a
j.p = n
j.q = n
j.s = i
f.w = b
f.s = j
f.q = a
i.p = b
i.r = n
i.u = c
assert i.u.p.q.u.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.o: E = None
        self.v: E = None
        self.p: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: C = None
        self.s: G = None
        self.q: C = None
        self.txt = txt

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

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

c = A("c")
b = B("b")
n = C("n")
a = D("a")
j = E("j")
f = F("f")
i = G("i")

c.t = a
c.o = j
c.v = j
c.p = n
b.s = f
n.q = i
n.p = c
n.o = f
n.u = f
n.r = a
a.p = n
j.u = a
j.p = n
j.q = n
j.s = i
f.w = b
f.s = j
f.q = a
i.p = b
i.r = n
i.u = c
assert i.u.p.q.u.txt == "c"