class A:
    def __init__(self, txt: str):
        self.v: F = None
        self.t: E = None
        self.x: F = None
        self.p: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.z: E = None
        self.v: F = None
        self.txt = txt

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

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.z: E = None
        self.v: F = None
        self.txt = txt

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

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

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

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

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

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