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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.v: F = None
        self.o: B = None
        self.w: B = None
        self.r: C = None
        self.txt = txt

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.v: F = None
        self.o: B = None
        self.w: B = None
        self.r: C = None
        self.txt = txt

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

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

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

e.u = j
e.q = j
e.v = i
e.s = c
e.y = c
h.r = j
h.t = n
h.x = n
h.u = b
h.s = b
h.o = c
c.x = h
c.p = h
c.u = j
j.u = c
b.x = c
b.r = c
b.v = i
b.o = h
b.w = h
i.t = c
n.v = e
n.u = j
n.q = c
assert b.w.t.u.u.txt == "c"