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

class B:
    def __init__(self, txt: str):
        self.t: G = None
        self.s: F = None
        self.w: C = None
        self.v: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.q: A = None
        self.p: F = None
        self.w: F = None
        self.r: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.u: C = None
        self.o: E = None
        self.z: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.s: B = None
        self.x: C = None
        self.y: B = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: G = None
        self.s: F = None
        self.w: C = None
        self.v: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.q: A = None
        self.p: F = None
        self.w: F = None
        self.r: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.u: C = None
        self.o: E = None
        self.z: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.s: B = None
        self.x: C = None
        self.y: B = None
        self.txt = txt

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

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

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